/*  1:   */ package org.jetbrains.lang.manifest.psi.impl;
/*  2:   */ 
/*  3:   */

import com.intellij.openapi.util.TextRange;
import com.intellij.psi.AbstractElementManipulator;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiFileFactory;
import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.lang.manifest.ManifestFileTypeFactory;
import org.jetbrains.lang.manifest.psi.Header;
import org.jetbrains.lang.manifest.psi.HeaderValue;
import org.jetbrains.lang.manifest.psi.HeaderValuePart;
import org.jetbrains.lang.manifest.psi.ManifestFile;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */
/* 12:   */
/* 13:   */
/* 14:   */
/* 15:   */ 
/* 16:   */ public class HeaderValuePartManipulator
/* 17:   */   extends AbstractElementManipulator<HeaderValuePart>
/* 18:   */ {
/* 19:   */   public HeaderValuePart handleContentChange(@NotNull HeaderValuePart paramHeaderValuePart, @NotNull TextRange paramTextRange, String paramString)
/* 20:   */     throws IncorrectOperationException
/* 21:   */   {
/* 22:44 */     if (paramHeaderValuePart == null) {
/* 23:44 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/lang/manifest/psi/impl/HeaderValuePartManipulator", "handleContentChange" }));
/* 24:   */     }
/* 25:44 */     if (paramTextRange == null) {
/* 26:44 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/lang/manifest/psi/impl/HeaderValuePartManipulator", "handleContentChange" }));
/* 27:   */     }
/* 28:44 */     String str = "HeaderValuePartManipulator: " + paramTextRange.replace(paramHeaderValuePart.getText(), paramString);
/* 29:45 */     PsiFile localPsiFile = PsiFileFactory.getInstance(paramHeaderValuePart.getProject()).createFileFromText("DUMMY.MF", ManifestFileTypeFactory.MANIFEST, str);
/* 30:46 */     HeaderValue localHeaderValue = ((Header)((ManifestFile)localPsiFile).getHeaders().get(0)).getHeaderValue();
/* 31:47 */     assert (localHeaderValue != null) : str;
/* 32:48 */     return (HeaderValuePart)paramHeaderValuePart.replace(localHeaderValue);
/* 33:   */   }
/* 34:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.lang.manifest.psi.impl.HeaderValuePartManipulator

 * JD-Core Version:    0.7.0.1

 */